import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by Bella on 26/05/2014.
 */
public class Royal {

    public static String[] wordsArray= {"royalty from london","british royalty","united kingdom dukes", "british dominions","house of windsor",
            "windsor castle", "royalty from berkshire", "english dukes", "kings and queens of the united kingdom", "princes and princesses of wales",
            " queen ", " king ", " prince ", " princess ", " duke ", " duchess ","princes and princesses"};

    public static String[] wordsArrayforCatLinks ={"royalty from london","british royalty","united kingdom dukes", "british dominions","house of windsor",
            "windsor castle", "royalty from berkshire", "english dukes", "kings and queens of the united kingdom", "princes and princesses of wales"
            ,"princes and princesses"};

    public static Set<RoyalCouples> royalCouples= new HashSet<RoyalCouples>();

    public static void main(String[] args) throws IOException {

       WebGraph webGraph = new WebGraph();
       PageNode link= new PageNode("http://simple.wikipedia.org/wiki/Prince_William,_Duke_of_Cambridge");
       Search.crawl(link);
        File file = new File("royal.txt");
        if (!file.exists()) {
            file.createNewFile();
        }
        FileWriter fw = new FileWriter(file.getAbsoluteFile());
        BufferedWriter bw = new BufferedWriter(fw);
        for (RoyalCouples c: royalCouples) {
            bw.write(c.toString() + "\n");
        }
        bw.close();
    }



}
